package com.linktrip.devicemanager.sms;

import java.util.ResourceBundle;

/**
 * 获取CMPP短信接口参数配置
 */
public class SMSConfig {

	private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("SMSConfig");

	public static String get(String key) {
		try {
			String value = resourceBundle.getString(key);
			return value;
		} catch (Exception e) {
			return "";
		}
	}

	/**
	 * 获取互联网短信网关IP
	 * 
	 * @return
	 */
	public static String getIp() {
		return SMSConfig.get("ip");
	}

	/**
	 * 获取互联网短信网关端口号
	 * 
	 * @return
	 */
	public static int getPort() {
		return Integer.parseInt(SMSConfig.get("port"));
	}

	/**
	 * 获取sp企业代码
	 * 
	 * @return
	 */
	public static String getSpId() {
		return SMSConfig.get("spId");
	}

	/**
	 * 获取sp下发短信号码
	 * 
	 * @return
	 */
	public static String getSpCode() {
		return SMSConfig.get("spCode");
	}

	/**
	 * 获取sp sharedSecret
	 * 
	 * @return
	 */
	public static String getSpSharedSecret() {
		return SMSConfig.get("sharedSecret");
	}

	/**
	 * 获取链接的次
	 * 
	 * @return
	 */
	public static int getConnectCount() {
		return Integer.parseInt(SMSConfig.get("connectCount"));
	}

	/**
	 * 获取链接的超时时
	 * 
	 * @return
	 */
	public static int getTimeOut() {
		return Integer.parseInt(SMSConfig.get("timeOut"));
	}

	/**
	 * 获取IOT短信TOKEN url
	 * 
	 * @return String
	 */
	public static String getIOTTokenUrl() {
		return SMSConfig.get("upiot.token.url");
	}

	/**
	 * 获取IOT短信TOKEN username
	 * 
	 * @return String
	 */
	public static String getIOTUserName() {
		return SMSConfig.get("upiot.username");
	}

	/**
	 * 获取IOT短信TOKEN password
	 * 
	 * @return String
	 */
	public static String getIOTPassWord() {
		return SMSConfig.get("upiot.password");
	}

	/**
	 * 获取IOT短信发送 url
	 * 
	 * @return String
	 */
	public static String getIOTSendSMSUrl() {
		return SMSConfig.get("upiot.send.url");
	}

	public static String getCallBackUrl() {
		return SMSConfig.get("callback.url");
	}

	public static String getTestCallBackUrl() {
		return SMSConfig.get("callback.testurl");
	}

	public static String getTestDevicesList() {
		return SMSConfig.get("test.device.list");
	}
}